<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">

</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="tu01(1)">1</a>
		<a href="#"onclick="tu01(2)">2</a>
		<a href="#"onclick="tu01(3)">3</a>
		<a href="#"onclick="tu01(4)">4</a>
		<a href="#"onclick="tu01(5)">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
</body>
<script type="text/javascript">
	function tu01(num){
		var tusrc = document.getElementById("photo");
		switch(num){
			case 1:
				tusrc.setAttribute("src","images/1.gif");
				break;
			case 2:
			tusrc.setAttribute("src","images/2.gif");
				break;
			case 3:
			tusrc.setAttribute("src","images/3.jpg");
				break;
			case 4:
			tusrc.setAttribute("src","images/4.jpg");
				break;
			case 5:
			tusrc.setAttribute("src","images/5.gif");
				break;
				default:
				alert("出错了！")
				break;
		}
	}
</script>
</html>
